package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.StudentLeave;
import com.ruoyi.system.mapper.StudentLeaveMapper;
import com.ruoyi.system.service.IStudentLeaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 请假记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-29
 */
@Service
public class StudentLeaveServiceImpl implements IStudentLeaveService
{
    @Autowired
    private StudentLeaveMapper studentLeaveMapper;

    /**
     * 查询请假记录
     * 
     * @param studentLeaveId 请假记录主键
     * @return 请假记录
     */
    @Override
    public StudentLeave selectStudentLeaveByStudentLeaveId(Long studentLeaveId)
    {
        return studentLeaveMapper.selectStudentLeaveByStudentLeaveId(studentLeaveId);
    }

    /**
     * 查询请假记录列表
     * 
     * @param studentLeave 请假记录
     * @return 请假记录
     */
    @Override
    public List<StudentLeave> selectStudentLeaveList(StudentLeave studentLeave)
    {
        return studentLeaveMapper.selectStudentLeaveList(studentLeave);
    }

    /**
     * 新增请假记录
     * 
     * @param studentLeave 请假记录
     * @return 结果
     */
    @Override
    public int insertStudentLeave(StudentLeave studentLeave)
    {
        return studentLeaveMapper.insertStudentLeave(studentLeave);
    }

    /**
     * 修改请假记录
     * 
     * @param studentLeave 请假记录
     * @return 结果
     */
    @Override
    public int updateStudentLeave(StudentLeave studentLeave)
    {
        return studentLeaveMapper.updateStudentLeave(studentLeave);
    }

    /**
     * 批量删除请假记录
     * 
     * @param studentLeaveIds 需要删除的请假记录主键
     * @return 结果
     */
    @Override
    public int deleteStudentLeaveByStudentLeaveIds(String studentLeaveIds)
    {
        return studentLeaveMapper.deleteStudentLeaveByStudentLeaveIds(Convert.toStrArray(studentLeaveIds));
    }

    /**
     * 删除请假记录信息
     * 
     * @param studentLeaveId 请假记录主键
     * @return 结果
     */
    @Override
    public int deleteStudentLeaveByStudentLeaveId(Long studentLeaveId)
    {
        return studentLeaveMapper.deleteStudentLeaveByStudentLeaveId(studentLeaveId);
    }
}
